{% extends 'layout.html' %}
{% block title %}
{{title}}
{% endblock %}

{% block secondtitle %}{{secondtitle}}{% endblock %}
{% block content %}
<div class="smooth">
    <div id="login" class="container w-xxl w-auto-xs">
        {% if !gitEmail %}
        <a href="/" class="navbar-brand block m-t">Docs.ren</a>
        {% endif %}
        <div class="m-b-lg">
            <div class="wrapper text-center">
                <a v-on="click:oauth" href="javascript:;"><i class="fa fa-github gitsize"></i></a>
                {% if gitEmail %}
                      <a href="javascript:;" class="navbar-brand block m-t-sm" id="bind-email" title="{{gitEmail}}">{{gitEmail}}</a>
                      <i class="fa fa-link link-css" title="github绑定账号"></i>
                {% endif %}
            </div>
            <form>
                <div class="list-group list-group-sm">
                    <div class="list-group-item">
                        <input v-model="user.email" v-validate="minLength: 3" value="{{gitEmail}}" placeholder="电子邮箱/个性域名" class="form-control no-border">
                    </div>
                    <div class="list-group-item">
                        <input v-model="user.pwd" v-validate="minLength: 6, maxLength: 16" type="password" placeholder="输入密码" class="form-control no-border">
                    </div>
                </div>
                <button type="submit" class="btn btn-lg btn-primary btn-block" v-attr="disabled:!valid" v-on="click:submit">
                    {%if gitEmail %}
                        绑 定
                    {% else %}
                        登 陆
                    {% endif %}
                </button>
                <div class="text-center m-t m-b"><a href="/forgat">忘记密码?</a></div>
                <div class="line line-dashed"></div>
                <p class="text-center">
                    <small>还没有账号?</small>
                </p>
                <a class="btn btn-lg btn-default btn-block" href="/signup">创建账号</a>
            </form>
        </div>

    </div>
</div>
{% endblock %}
{% block loadjs%}
<script>
    require(['user/login.min']);
</script>
{% endblock%}